package com.linoer.cloud.alo.storageservice.controller;

import com.linoer.cloud.alo.common.domain.ObjectResponse;
import com.linoer.cloud.alo.common.domain.dto.StorageDTO;
import com.linoer.cloud.alo.storageservice.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname StorageController
 * @Description TODO
 * @Date 2021/6/24 3:57 下午
 * @Created by muhenglv
 */
@RestController
@RequestMapping("/storage")
public class StorageController {

    @Autowired
    private StorageService storageService;

    @PostMapping("/decrease")
    public ObjectResponse decreaseStorage(@RequestBody StorageDTO storage){
        return storageService.deduct(storage);
    }
}
